/**
 * Create by yxk at 2020/6/12
 */
import request from '@/utils/request'

/**
 * 销售退货单新建/编辑
 */
export function jxcSalereturnAddOrUpdateAPI(data, isUpdate = false) {
  return request({
    url: 'jxcSalereturn/addOrUpdate' + (isUpdate ? '/update' : '/add'),
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 销售退货单删除
 */
export function jxcSalereturnDeleteByIdsAPI(data) {
  return request({
    url: 'jxcSalereturn/deleteByIds',
    method: 'post',
    data: data
  })
}

/**
 * 销售退货单详情
 */
export function jxcSalereturnQueryByIdAPI(data) {
  return request({
    url: `jxcSalereturn/queryById/${data.label}`,
    method: 'post',
    data: data
  })
}

/**
 * 查询可进行销售退货的商品
 */
export function jxcSalereturnQueryEdProductListAPI(data) {
  return request({
    url: 'jxcSalereturnProduct/queryEdSalereturnProductList',
    method: 'post',
    data: data
  })
}

/**
 * 查询销售退货单下的商品
 */
export function jxcSalereturnQueryProductListAPI(data) {
  return request({
    url: 'jxcSalereturnProduct/querySalereturnProductList',
    method: 'post',
    data: data
  })
}

/**
 * 销售退货单入库记录
 */
export function jxcSalereturnQueryRecordAPI(data) {
  return request({
    url: 'jxcSalereturn/queryRecord',
    method: 'post',
    data: data
  })
}

/**
 * 销售退货单作废
 */
export function jxcSalereturnSetStateByIdsAPI(data) {
  return request({
    url: 'jxcSalereturn/setStateByIds',
    method: 'post',
    data: data
  })
}
